<template>
    <div class="acc_diagram" v-show="userIsTM" :class="{acc_diagram_max:openRedundant}">
        <div class="acc_punctuality">
            <div id="acc_punctuality1" class="acc_punctuality_n"></div>
            <div id="acc_punctuality2" v-if="openRedundant" class="acc_punctuality_n"></div>
        </div>
        <div id="acc_turnoverC" class="acc_turnoverT">
            <timeList :list="acc_amount.timeList.list" v-on:timeList_d="timeList_d" class="acc_timeList"></timeList>
            <infList :list="acc_amount.infList.list" v-on:timeList_d="timeList_d" class="acc_infList"></infList>
            <label class="acc_che" v-if="screen.inf=='汇总'" @click="hzState(0)"><input type="checkbox" v-model="screen.gz">过站</label>
            <label class="acc_che" v-if="screen.inf=='汇总'" @click="hzState(1)"><input type="checkbox" v-model="screen.sf">甩飞</label>
            <button id="acc_turnoverBt" @click="changeTable" v-text="tableText"></button>
        </div>
        <div class="acc-turnover-box">
           <div class="acc_turnover" v-show="!tableShow">
               <div class="acc_titles">
                   <div>
                       <span>客流吞吐量</span>
                       <span class="acc_titles_ltem0">（人）</span>
                       <span class="acc_titles_ltem1" @click="switchs(0)">
                        <span :class="{acc_titles_ltem1x:screen.acc_.turn0.lx}">&#xe891;</span>
                        <span :class="{acc_titles_ltem1x:!screen.acc_.turn0.lx}">&#xe892;</span>
                    </span>
                   </div>
                   <div>
                       <span>汇总：<span class="acc_titles_ltem5">{{collectData.da1}}</span></span>
                       <span class="acc_titles_ltem0">人次</span>
                   </div>
               </div>
               <div id="acc_turnover0" class="acc_turnovers"></div>
           </div>
           <div class="acc_turnover" v-show="!tableShow">
               <div class="acc_titles">
                   <div>
                       <span>收入</span>
                       <span class="acc_titles_ltem0">（元）</span>
                       <span class="acc_titles_ltem1" @click="switchs(1)">
                        <span :class="{acc_titles_ltem1x:screen.acc_.turn1.lx}">&#xe891;</span>
                        <span :class="{acc_titles_ltem1x:!screen.acc_.turn1.lx}">&#xe892;</span>
                    </span>
                   </div>
                   <div>
                       <span>汇总：<span class="acc_titles_ltem5">{{collectData.da2}}</span></span>
                       <span class="acc_titles_ltem0">元</span>
                   </div>
               </div>
               <div id="acc_turnover1" class="acc_turnovers"></div>
           </div>
           <div class="acc_turnover" v-show="!tableShow">
               <div class="acc_titles">
                   <div>
                       <span>起降架次</span>
                       <span class="acc_titles_ltem0">（次）</span>
                       <span class="acc_titles_ltem1" @click="switchs(2)">
                        <span :class="{acc_titles_ltem1x:screen.acc_.turn2.lx}">&#xe891;</span>
                        <span :class="{acc_titles_ltem1x:!screen.acc_.turn2.lx}">&#xe892;</span>
                    </span>
                   </div>
                   <div>
                       <span>汇总：<span class="acc_titles_ltem5">{{collectData.da3}}</span></span>
                       <span class="acc_titles_ltem0">次</span>
                   </div>
               </div>
               <div id="acc_turnover2" class="acc_turnovers"></div>
           </div>
            <div class="acc_turnoverTable" v-if="tableShow">
                <table cellpadding="0" cellspacing="0" v-if="(Object.keys(tableD).length != 0)">
                    <thead>
                        <tr class="acc_turnoverTableH">
                            <th></th>
                            <th></th>
                            <th v-for="(key,name) in tableD" v-text="name"></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="acc_turnoverTableI">
                            <td rowspan="3">客流量（人）</td>
                            <td>进港</td>
                            <td v-for="(key,name) in tableD" v-text="key[0]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>出港</td>
                            <td v-for="(key,name) in tableD" v-text="key[1]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>合计</td>
                            <td v-for="(key,name) in tableD" v-text="key[2]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td rowspan="3">收入（元）</td>
                            <td>进港</td>
                            <td v-for="(key,name) in tableD" v-text="key[3]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>出港</td>
                            <td v-for="(key,name) in tableD" v-text="key[4]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>合计</td>
                            <td v-for="(key,name) in tableD" v-text="key[5]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td rowspan="3">起降架次（次）</td>
                            <td>进港</td>
                            <td v-for="(key,name) in tableD" v-text="key[6]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>出港</td>
                            <td v-for="(key,name) in tableD" v-text="key[7]"></td>
                        </tr>
                        <tr class="acc_turnoverTableI">
                            <td>合计</td>
                            <td v-for="(key,name) in tableD" v-text="(key[6] + key[7])"></td>
                        </tr>
                    </tbody>
                </table>
                <div v-else class="acc_turnoverTableN">无数据</div>
            </div>
        </div>
        <div style="width: 100%;height: 43px;"></div>
        <div id="acc_swith" class="acc_swithN" v-if="openrOne" @click="openR">&#xe67e;</div>
    </div>
</template>
<script>
    import * as vx from 'vuex'
    import list from './selected.vue'
    let color=["#7ebbe8","#2f5688","#d3a156","#eec494","#93a0b2","#c9877f","#cecfd1","#5871e2","#2761d2","#4526d2"];
    export default{
        data(){
            return{
                openTable:true,
                openRedundant:false,
                openrOne:false,
                acc_punctuality:{
                    title:{
                        show:true,
                        text:"准点率",
                        textStyle:{
                            color:"white",
                            fontWeight:"normal",
                            fontSize:"14"
                        },
                        left:35,
                        top:43
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: function(params){
                            if(params.data.linTyep==1){
                                return params.data.airName+"机场准点率为"+params.data.value+"%"
                            }
                        }
                    },
                    legend: {
                        orient: 'vertical',
                        left:35,
                        top:70,
                        textStyle:{
                            color:"white"
                        },
                        selectedMode:false,
                        data:[]
                    },
                    series: []
                },
                acc_amount:{
                    timeList:{
                        list:[
                            {
                                name:7,
                                se:true
                            },
                            {
                                name:30,
                                se:false
                            }
                        ]
                    },
                    infList:{
                        list:[
                            {
                                name:"汇总",
                                se:true
                            },
                            {
                                name:"进港",
                                se:false
                            },
                            {
                                name:"出港",
                                se:false
                            }
                        ]
                    }
                },
                screen:{
                    time:7,
                    inf:'汇总',
                    gz:false,
                    sf:false,
                    acc_:{
                        turn0:{
                            lx:true,
                            das:[]
                        },
                        turn1:{
                            lx:true,
                            das:[]
                        },
                        turn2:{
                            lx:true,
                            das:[]
                        },
                    }
                },
                collectData:{
                    da1:0,
                    da2:0,
                    da3:0,
                },
                tableD:{
                },
                tableText:"切换到表格",
                tableShow:false,
                userIsTM: true
            }
        },
        methods:{
            ...vx.mapActions([
            ]),
            changeTable:function () {
                if(!this.tableShow){
                    this.tableText = "切换到图表";
                    this.tableShow = true;
                    this.openTable = false;
                }else{
                    this.tableText = "切换到表格";
                    this.tableShow = false;
                    this.openTable = true;
                    setTimeout(()=>{
                        this.assembly();
                    },150);
                }
            },
            draw:function(){
                if(this.openrOne){
                    if(this.openRedundant){
                        let portalDataArr=[];
                        for(let key in this.portalData.list){
                            portalDataArr.push({
                                data:this.portalData.list[key],
                                code:key
                            });
                            let arr=this.portalData.list[key].zdl.split("(")[1].split(")")[0].split("-");
                            this.acc_punctuality.title.text=arr[0]+"."+arr[1]+"准点率";
                        };
                        let arr=[];
                        let lenArr=[];
                        let thickness=60;
                        let le=parseInt(40/9);

                        let lportalData=[];
                        for (let i=0;i<9;i++){
                            lportalData.push(JSON.parse(JSON.stringify(portalDataArr[i])));
                        }
                        let i = 0, len = lportalData.length, j, d ;
                        for(; i<len; i++){
                            for(j=0; j<len; j++){
                                if(lportalData[i].data.zdl.split("%")[0] > lportalData[j].data.zdl.split("%")[0] ){
                                    d = JSON.parse(JSON.stringify(lportalData[j]));
                                    lportalData[j] = JSON.parse(JSON.stringify(lportalData[i]));
                                    lportalData[i] = d;
                                }
                            }
                        }
                        let maxTime="";
                        for(let i=0;i<lportalData.length;i++){
                            let ti=lportalData[i].data.zdl.split("(")[1].split(")")[0].split("-");
                            if(maxTime!=""){
                                if(ti[1]>maxTime){
                                    maxTime=parseFloat(ti[1]);
                                }
                            }else{
                                maxTime=parseFloat(ti[1]);
                            }
                        }
                        for(let i=0;i<lportalData.length;i++){
                            let ti=lportalData[i].data.zdl.split("(")[1].split(")")[0].split("-");
                            if(ti[1]==maxTime){
                                thickness=thickness-le;
                                arr.push( {
                                    type:'pie',
                                    hoverAnimation:false,
                                    radius: [(thickness+le)+"%", thickness+'%'],
                                    center:['70%','50%'],
                                    itemStyle:{
                                        normal:{
                                            color:color[i]
                                        }
                                    },
                                    label:{
                                        normal: {
                                            show: false,
                                            position: 'center'
                                        }
                                    },
                                    data:[
                                        {
                                            value:100-parseFloat(this.portalData.list[lportalData[i].code].zdl),
                                            name:'占比',
                                            linTyep:0,
                                            itemStyle:{
                                                normal:{
                                                    color:'rgba(0,0,0,0)'
                                                }
                                            }
                                        },
                                        {value:parseFloat(this.portalData.list[lportalData[i].code].zdl), name:this.portalData.airportInfoMap[lportalData[i].code].iata,linTyep:1,airName:this.portalData.airportInfoMap[lportalData[i].code].aptChaNam},
                                    ]
                                });
                                lenArr.push(this.portalData.airportInfoMap[lportalData[i].code].iata);
                            }
                        }
                        this.acc_punctuality.legend.data=lenArr;
                        this.acc_punctuality.series=arr;

                        let acc_punctuality1=document.getElementById("acc_punctuality1");
                        let myChart_acc_punctuality1 = echarts.init(acc_punctuality1);
                        myChart_acc_punctuality1.setOption(this.acc_punctuality, true);
                        // -----------------------

                        portalDataArr=[];
                        for(let key in this.portalData.list){
                            portalDataArr.push({
                                data:this.portalData.list[key],
                                code:key
                            });
                        };
                        arr=[];
                        lenArr=[];
                        thickness=60;
                        le=parseInt(40/9);

                        lportalData=[];
                        for (let i=9;i<portalDataArr.length;i++){
                            lportalData.push(JSON.parse(JSON.stringify(portalDataArr[i])));
                        }
                        i = 0, len = lportalData.length, j, d ;
                        for(; i<len; i++){
                            for(j=0; j<len; j++){
                                if(lportalData[i].data.zdl.split("%")[0] < lportalData[j].data.zdl.split("%")[0] ){
                                    d = JSON.parse(JSON.stringify(lportalData[j]));
                                    lportalData[j] = JSON.parse(JSON.stringify(lportalData[i]));
                                    lportalData[i] = d;
                                }
                            }
                        }
                        for(let i=0;i<lportalData.length;i++){
                            thickness=thickness-le;
                            arr.push( {
                                type:'pie',
                                hoverAnimation:false,
                                radius: [(thickness+le)+"%", thickness+'%'],
                                center:['70%','50%'],
                                itemStyle:{
                                    normal:{
                                        color:color[i]
                                    }
                                },
                                label:{
                                    normal: {
                                        show: false,
                                        position: 'center'
                                    }
                                },
                                data:[
                                    {
                                        value:100-parseFloat(this.portalData.list[lportalData[i].code].zdl),
                                        name:'占比',
                                        linTyep:0,
                                        itemStyle:{
                                            normal:{
                                                color:'rgba(0,0,0,0)'
                                            }
                                        }
                                    },
                                    {value:parseFloat(this.portalData.list[lportalData[i].code].zdl), name:this.portalData.airportInfoMap[lportalData[i].code].iata,linTyep:1,airName:this.portalData.airportInfoMap[lportalData[i].code].aptChaNam},
                                ]
                            });
                            lenArr.push(this.portalData.airportInfoMap[lportalData[i].code].iata);
                        }
                        this.acc_punctuality.legend.data=lenArr;
                        this.acc_punctuality.series=arr;
                        let acc_punctuality2=document.getElementById("acc_punctuality2");
                        let myChart_acc_punctuality2 = echarts.init(acc_punctuality2);
                        myChart_acc_punctuality2.setOption(this.acc_punctuality, true);
                    }else{

                    }
                }else{
                    let thickness=60;
                    let arr=[];
                    let lenArr=[];
                    let le=0;
                    for(let key in this.portalData.list){
                        le++
                    }
                    le=parseInt(40/le);
                    let lportalData=[];
                    for(let key in this.portalData.list){
                        lportalData.push({
                            data:this.portalData.list[key],
                            code:key
                        });
                        let arr=this.portalData.list[key].zdl.split("(")[1].split(")")[0].split("-");
                        this.acc_punctuality.title.text=arr[0]+"."+arr[1]+"准点率";
                    };
                    let i = 0, len = lportalData.length, j, d ;
                    for(; i<len; i++){
                        for(j=0; j<len; j++){
                            if(lportalData[i].data.zdl.split("%")[0] >lportalData[j].data.zdl.split("%")[0] ){
                                d = JSON.parse(JSON.stringify(lportalData[j]));
                                lportalData[j] = JSON.parse(JSON.stringify(lportalData[i]));
                                lportalData[i] = d;
                            }
                        }
                    }
                    let maxTime="",maxName = '';
                    for(let i=0;i<lportalData.length;i++){
                        let ti=lportalData[i].data.zdl.split("(")[1].split(")")[0].split("-");
                        var num = Number(ti[0]+ti[1]);
                        if(maxName!=""){
                            if(num>maxName){
                                maxName=parseFloat(num);
                                maxTime = ti[1];
                            }
                        }else{
                            maxName=parseFloat(num);
                            maxTime = ti[1];
                        }
                    }
                    for(let i=0;i<lportalData.length;i++){
                        let ti=lportalData[i].data.zdl.split("(")[1].split(")")[0].split("-");
                        if(ti[1]==maxTime){
                            thickness=thickness-le;
                            arr.push( {
                                type:'pie',
                                hoverAnimation:false,
                                radius: [(thickness+le)+"%", thickness+'%'],
                                center:['70%','50%'],
                                itemStyle:{
                                    normal:{
                                        color:color[i]
                                    }
                                },
                                label:{
                                    normal: {
                                        show: false,
                                        position: 'center'
                                    }
                                },
                                data:[
                                    {
                                        value:100-parseFloat(this.portalData.list[lportalData[i].code].zdl),
                                        name:'占比',
                                        linTyep:0,
                                        itemStyle:{
                                            normal:{
                                                color:'rgba(0,0,0,0)'
                                            }
                                        }
                                    },
                                    {value:parseFloat(this.portalData.list[lportalData[i].code].zdl), name:this.portalData.airportInfoMap[lportalData[i].code].iata,linTyep:1,airName:this.portalData.airportInfoMap[lportalData[i].code].aptChaNam},
                                ]
                            });
                            lenArr.push(this.portalData.airportInfoMap[lportalData[i].code].iata);
                        }
                    }
                    this.acc_punctuality.legend.data=lenArr;
                    this.acc_punctuality.series=arr;
                    let acc_punctuality=document.getElementById("acc_punctuality1");
                    let myChart_acc_punctuality = echarts.init(acc_punctuality);
                    myChart_acc_punctuality.setOption(this.acc_punctuality, true);
                }
            },
            timeList_d:function (val) {
                if(typeof val == "number"){
                   this.screen.time=val;
                    this.assembly();
                    this.tableData(val == 7 ? 1 : 0);
                }else{
                    this.screen.inf=val;
                    this.assembly();
                }
            },
            acc_turn0:function () {
                let myChart_acc_turnover0= echarts.init(document.getElementById("acc_turnover0"));
                let das=[];
                let dasN=[];
                let dasC=[];
                if(this.openrOne){
                    if(this.openRedundant){
                        for(let i=0;i<this.screen.acc_.turn0.das.data.length;i++){
                            das.push(this.screen.acc_.turn0.das.data[i]);
                            dasN.push(this.screen.acc_.turn0.das.name[i]);
                            dasC.push(this.screen.acc_.turn0.das.code[i]);
                        }
                    }else {
                        for(let i=0;i<9;i++){
                            das.push(this.screen.acc_.turn0.das.data[i]);
                            dasN.push(this.screen.acc_.turn0.das.name[i]);
                            dasC.push(this.screen.acc_.turn0.das.code[i]);
                        }
                    }
                }else{
                    dasN=this.screen.acc_.turn0.das.name;
                    das=this.screen.acc_.turn0.das.data;
                    dasC=this.screen.acc_.turn0.das.code;
                }
                let option = {
                    "title": {
                        "show": false,
                        "left": "center",
                        "textStyle": {"color": "#fff"}
                    },
                    color: ['#3398DB'],
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '35',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',
                            data : dasC,
                            axisTick: {
                                show:false
                            },
                            axisLabel:{
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisLine:{
                                lineStyle:{
                                    color:'#727c8e'
                                }
                            }
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            show:true,
                            axisLine:{
                                lineStyle:{
                                    color:'#32415a'
                                }
                            },
                            axisLabel:{
                                interval: 'auto',
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisTick:{
                                show:false
                            }

                        }
                    ],
                    series : [
                        {
                            name:'人数',
                            type:'bar',
                            barWidth: 4,
                            itemStyle:{
                                normal:{
                                    color:"#79b5e0"
                                }
                            },
                            markLine:{
                                lineStyle:{
                                    normal:{
                                        color:"red"
                                    }
                                }
                            },
                            data:das
                        }
                    ]
                };
                myChart_acc_turnover0.setOption(option,true)
            },
            acc_turn1:function () {
                let myChart_acc_turnover1= echarts.init(document.getElementById("acc_turnover1"));
                let das=[];
                let dasN=[];
                let dasC=[];
                if(this.openrOne){
                    if(this.openRedundant){
                        for(let i=0;i<this.screen.acc_.turn1.das.data.length;i++){
                            das.push(this.screen.acc_.turn1.das.data[i]);
                            dasN.push(this.screen.acc_.turn1.das.name[i]);
                            dasC.push(this.screen.acc_.turn1.das.code[i]);
                        }
                    }else {
                        for(let i=0;i<9;i++){
                            das.push(this.screen.acc_.turn1.das.data[i]);
                            dasN.push(this.screen.acc_.turn1.das.name[i]);
                            dasC.push(this.screen.acc_.turn1.das.code[i]);
                        }
                    }
                }else{
                    dasN=this.screen.acc_.turn1.das.name;
                    das=this.screen.acc_.turn1.das.data;
                    dasC=this.screen.acc_.turn1.das.code;
                }
                let option = {
                    "title": {
                        "show": false,
                        "left": "center",
                        "textStyle": {"color": "#fff"}
                    },
                    color: ['#3398DB'],
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '35',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',

                            data : dasC,
                            axisTick: {
                                show:false
                            },
                            axisLabel:{
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisLine:{
                            lineStyle:{
                                color:'#727c8e'
                            }
                        }
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            show:true,
                            axisLine:{
                                lineStyle:{
                                    color:'#32415a'
                                }
                            },
                            axisLabel:{
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisTick:{
                                show:false
                            }

                        }
                    ],

                    series : [
                        {
                            name:'收入',
                            type:'bar',
                            barWidth: 4,
                            itemStyle:{
                                normal:{
                                    color:"#79b5e0"
                                }
                            },
                            markLine:{
                                lineStyle:{
                                    normal:{
                                        color:"red"
                                    }
                                }
                            },
                            data:das
                        }
                    ]
                };
                myChart_acc_turnover1.setOption(option,true)
            },
            acc_turn2:function () {
                let myChart_acc_turnover2= echarts.init(document.getElementById("acc_turnover2"));
                let das=[];
                let dasN=[];
                let dasC=[];
                if(this.openrOne){
                    if(this.openRedundant){
                        for(let i=0;i<this.screen.acc_.turn2.das.data.length;i++){
                            das.push(this.screen.acc_.turn2.das.data[i]);
                            dasN.push(this.screen.acc_.turn2.das.name[i]);
                            dasC.push(this.screen.acc_.turn2.das.code[i]);
                        }
                    }else {
                        for(let i=0;i<9;i++){
                            das.push(this.screen.acc_.turn2.das.data[i]);
                            dasN.push(this.screen.acc_.turn2.das.name[i]);
                            dasC.push(this.screen.acc_.turn2.das.code[i]);
                        }
                    }
                }else{
                    dasN=this.screen.acc_.turn2.das.name;
                    das=this.screen.acc_.turn2.das.data;
                    dasC=this.screen.acc_.turn2.das.code;
                }
                let option = {
                    "title": {
                        "show": false,
                        "left": "center",
                        "textStyle": {"color": "#fff"}
                    },
                    color: ['#3398DB'],
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '35',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            type : 'category',

                            data :dasC,
                            axisTick: {
                                show:false
                            },
                            axisLabel:{
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#727c8e'
                                }

                            }
                        }
                    ],
                    yAxis : [
                        {
                            type : 'value',
                            show:true,
                            axisLine:{
                                lineStyle:{
                                    color:'#32415a'
                                }
                            },
                            axisLabel:{
                                textStyle:{
                                    color:'#687283'
                                }
                            },
                            splitLine:{
                                show:true,
                                lineStyle:{
                                    color:"#33425a"
                                }
                            },
                            axisTick:{
                                show:false
                            }

                        }
                    ],
                    series : [
                        {
                            name:'起降架次',
                            type:'bar',
                            barWidth: 4,
                            itemStyle:{
                                normal:{
                                    color:"#79b5e0"
                                }
                            },
                            markLine:{
                                lineStyle:{
                                    normal:{
                                        color:"red"
                                    }
                                }
                            },
                            data:das
                        }
                    ]
                };
                myChart_acc_turnover2.setOption(option,true)
            },
            assembly:function () {
                let acc_turn0={
                    name:[],
                    data:[],
                    code:[]
                };
                let acc_turn1={
                    name:[],
                    data:[],
                    code:[]
                };
                let acc_turn2={
                    name:[],
                    data:[],
                    code:[]
                };
                this.collectData.da1=0;
                this.collectData.da2=0;
                this.collectData.da3=0;
                for(let key in this.portalData.list){
                    if(this.portalData.list[key].portalDatas!=null&&this.portalData.list[key].portalDatas!=undefined){
                        if(this.screen.time==30){
                            if(this.screen.inf=='汇总'){
                                if(this.screen.gz&&!this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].pzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].pzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].pzjc);
                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[0].pzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[0].pzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[0].pzjc);
                                }else if(!this.screen.gz&&this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].tzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].tzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].tzjc);
                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[0].tzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[0].tzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[0].tzjc);
                                }else if(this.screen.gz&&this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].zkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].zsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].zjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[0].zkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[0].zsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[0].zjc);
                                }else if(!this.screen.gz&&!this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].nzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].nzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].nzjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[0].nzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[0].nzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[0].nzjc);
                                }
                            }else if(this.screen.inf=='进港'){
                                this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].jzkl);
                                this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].jzsr);
                                this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].jzjc);

                                acc_turn0.data.push(this.portalData.list[key].portalDatas[0].jzkl);
                                acc_turn1.data.push(this.portalData.list[key].portalDatas[0].jzsr);
                                acc_turn2.data.push(this.portalData.list[key].portalDatas[0].jzjc);
                            }else if(this.screen.inf=='出港'){
                                this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[0].czkl);
                                this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[0].czsr);
                                this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[0].czjc);

                                acc_turn0.data.push(this.portalData.list[key].portalDatas[0].czkl);
                                acc_turn1.data.push(this.portalData.list[key].portalDatas[0].czsr);
                                acc_turn2.data.push(this.portalData.list[key].portalDatas[0].czjc);
                            }
                            acc_turn0.name.push(this.portalData.airportInfoMap[key].aptChaNam);
                            acc_turn1.name.push(this.portalData.airportInfoMap[key].aptChaNam);
                            acc_turn2.name.push(this.portalData.airportInfoMap[key].aptChaNam);

                            acc_turn0.code.push(this.portalData.airportInfoMap[key].iata);
                            acc_turn1.code.push(this.portalData.airportInfoMap[key].iata);
                            acc_turn2.code.push(this.portalData.airportInfoMap[key].iata);
                        }else if(this.screen.time==7){
                            if(this.screen.inf=='汇总'){
                                if(this.screen.gz&&!this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].pzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].pzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].pzjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[1].pzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[1].pzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[1].pzjc);
                                }else if(!this.screen.gz&&this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].tzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].tzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].tzjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[1].tzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[1].tzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[1].tzjc);
                                }else if(this.screen.gz&&this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].zkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].zsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].zjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[1].zkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[1].zsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[1].zjc);
                                }else if(!this.screen.gz&&!this.screen.sf){
                                    this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].nzkl);
                                    this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].nzsr);
                                    this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].nzjc);

                                    acc_turn0.data.push(this.portalData.list[key].portalDatas[1].nzkl);
                                    acc_turn1.data.push(this.portalData.list[key].portalDatas[1].nzsr);
                                    acc_turn2.data.push(this.portalData.list[key].portalDatas[1].nzjc);
                                }
                            }else if(this.screen.inf=='进港'){
                                this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].jzkl);
                                this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].jzsr);
                                this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].jzjc);

                                acc_turn0.data.push(this.portalData.list[key].portalDatas[1].jzkl);
                                acc_turn1.data.push(this.portalData.list[key].portalDatas[1].jzsr);
                                acc_turn2.data.push(this.portalData.list[key].portalDatas[1].jzjc);
                            }else if(this.screen.inf=='出港'){
                                this.collectData.da1+=parseFloat(this.portalData.list[key].portalDatas[1].czkl);
                                this.collectData.da2+=parseFloat(this.portalData.list[key].portalDatas[1].czsr);
                                this.collectData.da3+=parseFloat(this.portalData.list[key].portalDatas[1].czjc);
                                acc_turn0.data.push(this.portalData.list[key].portalDatas[1].czkl);
                                acc_turn1.data.push(this.portalData.list[key].portalDatas[1].czsr);
                                acc_turn2.data.push(this.portalData.list[key].portalDatas[1].czjc);
                            }
                        acc_turn0.name.push(this.portalData.airportInfoMap[key].aptChaNam);
                        acc_turn1.name.push(this.portalData.airportInfoMap[key].aptChaNam);
                        acc_turn2.name.push(this.portalData.airportInfoMap[key].aptChaNam);

                        acc_turn0.code.push(this.portalData.airportInfoMap[key].iata);
                        acc_turn1.code.push(this.portalData.airportInfoMap[key].iata);
                        acc_turn2.code.push(this.portalData.airportInfoMap[key].iata);
                    }
                }};
                this.screen.acc_.turn0.das=acc_turn0;
                this.screen.acc_.turn1.das=acc_turn1;
                this.screen.acc_.turn2.das=acc_turn2;
                this.sequence( this.screen.acc_.turn0,"turn0");
                this.sequence( this.screen.acc_.turn1,"turn1");
                this.sequence( this.screen.acc_.turn2,"turn2");
                this.acc_turn0();
                this.acc_turn1();
                this.acc_turn2();
            },
            tableData:function (id){
                let data = {};
                for(let key in this.portalData.list){
                    if(this.portalData.list[key].portalDatas != undefined){
                        if(data[key] == undefined)data[key] = []
                        let nsd = this.portalData.list[key].portalDatas[id];
                        data[key].push(nsd.jzkl,nsd.czkl); //
                        if(this.screen.gz && this.screen.sf){
                            data[key].push(nsd.zkl,nsd.jzsr,nsd.czsr,nsd.zsr); //
                        }else if(!this.screen.gz && !this.screen.sf){
                            data[key].push(nsd.nzkl,nsd.jzsr,nsd.czsr,nsd.nzsr); //
                        }else if(!this.screen.gz && this.screen.sf){
                            data[key].push(nsd.tzkl,nsd.jzsr,nsd.czsr,nsd.tzsr); //
                        }else if(this.screen.gz && !this.screen.sf){
                            data[key].push(nsd.pzkl,nsd.jzsr,nsd.czsr,nsd.pzsr); //
                        };
                        data[key].push(nsd.jzjc,nsd.czjc); //
                    }
                };
                this.tableD = data;
            },
            sequence:function (val,kes) {
                let data=val.das.data;
                let name=val.das.name;
                let code=val.das.code;
                let i = 0, len = data.length, j, d ,n,p;
                for(; i<len; i++){
                    for(j=0; j<len; j++){
                        if(val.lx){
                            if(data[i] > data[j]){
                                d = data[j];
                                data[j] = data[i];
                                data[i] = d;

                                n=name[j];
                                name[j] = name[i];
                                name[i] = n;

                                p=code[j];
                                code[j] = code[i];
                                code[i] = p;
                            }
                        }else {
                            if(data[i] < data[j]){
                                d = data[j];
                                data[j] = data[i];
                                data[i] = d;

                                n=name[j];
                                name[j] = name[i];
                                name[i] = n;

                                p=code[j];
                                code[j] = code[i];
                                code[i] = p;
                            }
                        }
                    }
                }

                this.$set(this.screen.acc_[kes].das,"data",data);
                this.$set(this.screen.acc_[kes].das,"name",name);
            },
            switchs:function (num) {
                if(num==0){
                    this.screen.acc_.turn0.lx=!this.screen.acc_.turn0.lx;
                    this.sequence(this.screen.acc_.turn0,"turn0");
                    this.acc_turn0();
                }else if(num==1){
                    this.screen.acc_.turn1.lx=!this.screen.acc_.turn1.lx;
                    this.sequence( this.screen.acc_.turn1,"turn1");
                    this.acc_turn1();
                }else if(num==2){
                    this.screen.acc_.turn2.lx=!this.screen.acc_.turn2.lx;
                    this.sequence( this.screen.acc_.turn2,"turn2");
                    this.acc_turn2();
                }
            },
            hzState:function (num) {
                this.assembly();
                this.tableData(this.screen.inf == 7 ? 1 : 0);
            },
            openR:function () {
                if(this.openrOne){
                    this.openRedundant?this.openRedundant=false:this.openRedundant=true;
                    setTimeout(()=>{
                        this.draw();
                        this.acc_turn0();
                        this.acc_turn1();
                        this.acc_turn2();
                    },100);
                }
            }
        },
        computed:{
            ...vx.mapGetters([
                'menuc',
                'portalData'
            ]),
            assemblyImg:function () {
            }
        },
        mounted: function () {
            setTimeout(()=>{
                this.userIsTM = this.menuc.head.CNtext==="太美集团"?false:true;
            },1500)
        },
        watch:{
            portalData:function () {
                let i=0;
                for(let key in this.portalData.list){
                    i++;
                }
                if(i>=9){
                    this.openrOne=true;
                }else {
                    this.openrOne=false;
                }
                this.assembly();
                this.draw();
                this.tableData(1);
            }
        },
        components:{
            timeList:list,
            infList:list
        }
    }
</script>
<style>

</style>